Get Attribute
AutomatR.Web.GetAttribute
The "Get Attribute" activity in AutomatR's Web Activities category retrieves the value of a specified attribute of a UI element on a web page. This activity is useful when you need to capture information such as the text, href, or other attributes of a particular web element during automation.
Properties
Name | Description |
---|---|
Input | |
Attribute | Enter the name of the attribute for which you want to retrieve the value. String variables containing the attribute name. |
Web Selector | Select the web element to indicate the element on the web using the selector window. Only one of "Web Selector" or "Web Element" should be provided. |
Web Element | Enter UI Element variable identified by Find Element or another activity. Only one of "Web Selector" or "Web Element" should be provided. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. String variables containing the desired display name. |
Optional | |
Timeout | Enter the time in seconds (e.g., 5 seconds) for the activity to be executed before throwing an exception. Default timeout is used if not specified. |
Delay | Enter the wait time in seconds (e.g., 5 seconds) before starting the activity. Useful for handling synchronization issues. |
Output | |
Result | Returns the value of the specified attribute as a string. Variable of type string to store the attribute value. |
How to use:
- Drag and drop the "Get Attribute" activity onto the workflow.
- Choose either the "Web Selector" or "Web Element" property to indicate the web element for which you want to retrieve the attribute value.
- Specify the name of the attribute you want to retrieve using the "Attribute" property.
- Optionally, configure the "Timeout" and "Delay" properties based on your requirements.
- Execute the workflow to retrieve the value of the specified attribute.
Example: Consider an example where the "Get Attribute" activity is used to retrieve the "href" attribute value of a link on a web page:
Get Attribute:
Web Selector: <your_selector_here>
Attribute: "href"
Timeout: 10
Delay: 2
Result: linkHref
In this example, the activity fetches the "href" attribute value of the specified web element, and the result is stored in the variable "linkHref" for further use in the workflow.